{% extends 'lbforum/base.html' %}

{% load i18n %}
{% load lbforum %}

{% block title %}
    {{ topic.subject }} - {{ block.super }}
{% endblock %}

{% block content %}
    <div id="replybox">
        <div id="actionbox">
        </div>
    </div>
    <div id="brd-wrap" class="brd">
        <div id="brd-viewtopic" class="brd-page paged-page">
            {% include 'lbforum/inc_header.html' %}
            {% include 'lbforum/inc_announce.html' %}
            <div class="hr"><hr/></div>
            <div id="brd-crumbs-top" class="crumbs gen-content">
                {% include 'lbforum/inc_topic_brd_crumbs.html' %}
            </div>
            <div class="main-wrapper" id="brd-main">
                <div class="main-pagepost gen-content" id="brd-pagepost-top">
                    {% load pagination_tags_q %}
                    
                    {% autopaginate_q topic Post 20 %}
                    {% paginate_q %}
                    
                    <p class="posting">
                        {% if not topic.closed %} 
                            {% if user.is_authenticated %}
                                <!--  <a class="newpost" href="{% url lbforum_new_replay topic.seq %}"><span>Post reply</span></a> -->
                                <a class="newpost" href="{% url lbforum_new_replay topic.seq %}"><span><!--  {% trans "post reply" %}--> 回复</span></a>
                            {% else %}
                                {% trans "You must" %} <a href="{% url auth_login %}">{% trans "Login" %}</a> {% trans "or" %} <a href="{% url registration_register %}">{% trans "register" %}</a><!-- {% trans "to post a reply" %} --> 才能发表回复
                            {% endif %} 
                        {% endif %}
                    </p>
                </div>
                <div class="main-head">
                    <h1 class="hn"><span><a title="Permanent link to this topic" rel="bookmark" href="{{ topic.get_absolute_url }}" class="permalink">{{ topic }}</a></span></h1>
                </div>
                <div class="main-pagehead">
                    <h2 class="hn"><span><span class="item-info">{% trans "Posts" %} [ {% page_range_info page_obj %} ]</span></span></h2>
                </div>
                <div class="main-content main-topic" id="forum">
                    {% for post in page.object_list %} 
                        {% include 'lbforum/inc_post_detail.html' %}
                    {% endfor %}
                </div>
                <div class="main-options gen-content">
                    <p class="options"></p>
                </div>
                {% paginate_q %}
                <div class="main-pagepost gen-content" id="brd-pagepost-end">
                    
                    <p class="posting">
                        {% if not topic.closed %}
                            {% if user.is_authenticated %}
                                <a class="newpost" href="{% url lbforum_new_replay topic.seq %}"><span><!--  {% trans "Reply" %}--> 回复</span></a>
                            {% else %}
                                {% trans "You must" %} <a href="{% url auth_login %}">{% trans "Login" %}</a> {% trans "or" %} <a href="{% url registration_register %}">{% trans "register" %}</a><!--   {% trans "to reply" %} --> 才能发表回复
                            {% endif %} 
                        {% endif %}
                    </p>
                </div>
            </div>
            <div class="crumbs gen-content" id="brd-crumbs-end">
                {% include 'lbforum/inc_topic_brd_crumbs.html' %}
            </div>
            {% if not topic.closed %} {% if user.is_authenticated %}
                    <div class="main-subhead">
                        <h2 class="hn"><span>{% trans "Quick reply to this topic" %}</span></h2>
                    </div>
                    <div class="main-content main-frm" id="brd-qpost">
                        <!--  <p class="content-options options">You may use: <span class="item1"><a title="Help with: BBCode" href="http://fluxbb.org/forums/help/bbcode/" class="exthelp">BBCode</a></span> <span><a title="Help with: Images" href="http://fluxbb.org/forums/help/img/" class="exthelp">Images</a></span> <span><a title="Help with: Smilies" href="http://fluxbb.org/forums/help/smilies/" class="exthelp">Smilies</a></span></p> -->
                        <form action="{% url lbforum_new_replay topic.seq %}" accept-charset="utf-8" method="post" class="frm-form">
                            <div class="hidden">
                                { % csrf_token % } 
                            </div>
                            <fieldset class="frm-group group1">
                                <legend class="group-legend"><strong>Compose your post</strong></legend>
                                <div class="txt-set set1">
                                    <div class="txt-box textarea required">
                                        <label for="fld1"><span>{% trans "reply content"%}: <em>({% trans "Required"%})</em></span></label>
                                        <div class="txt-input"><span class="fld-input"><textarea cols="95" rows="7" name="message" id="fld1"></textarea></span></div>
                                    </div>
                                </div>
                            </fieldset>
                            <div class="frm-buttons">
                                <span class="submit"><input type="submit" value="{% trans "submit" %}" name="submit"/></span>
                                <span class="submit"><input type="submit" value="{% trans "Preview" %}" name="preview"/></span>
                            </div>
                        </form>
                    </div>
                {% endif %} {% endif %}
                
            <div class="hr"><hr /></div>
            {% include 'lbforum/inc_copyright.html' %}
        </div>
    </div>
{% endblock %}
